package org.xxx.epms.oss.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.xxx.epms.common.api.CommonResult;
import org.xxx.epms.oss.service.QiniuFileStorageService;

@RequestMapping("/oss/qiniu")
@RestController
public class QiniuController {
    @Autowired
    private QiniuFileStorageService qiniuFileStorageService;

    @RequestMapping(value = "/getUploadToken", method = RequestMethod.GET)
    public CommonResult<String> getUploadToken(@RequestParam(value = "fileName") String fileName) {
        return CommonResult.success(qiniuFileStorageService.getUploadToken(fileName));
    }

}
